@import "../variables";
@import "../mixins/clearfix";

.order {
  &__tabs {
    position: relative;
    margin-top: 50px;
    margin-bottom: 20px;

    .tabs {
      &__inner {
        margin: 0;
        padding: 0;
        list-style: none;
        border-bottom: 2px solid #E4E7ED;
        @include clearfix();
      }

      &__item {
        float: left;

        > a {
          display: block;
          position: relative;
          min-width: 120px;
          padding: 14px 20px;
          font-size: 16px;
          font-weight: 600;
          line-height: (18 / 16);
          color: #464F5D;
          text-align: center;

          &:hover, &:focus {
            text-decoration: none;
          }

          &:before, &:after {
            position: absolute;
            content: '';
          }

          &:before {
            width: 2px;
            height: 10px;
            top: 50%;
            right: -1px;
            margin-top: -5px;
            background-color: #D0D6E1;
          }

          &:after {
            width: 100%;
            height: 2px;
            left: 0;
            bottom: -2px;
            background-color: #E4E7ED;
          }
        }

        &.active > a,
        & > a:hover,
        & > a:focus {
          color: $primary;

          &:after {
            background-color: $primary;
          }
        }
      }

      &__right {
        position: absolute;
        right: 6px;
        bottom: 7px;
        width: 200px;

        .form-control {
          height: 30px;
          padding: 6px 11px 7px;
          font-size: 13px;
          border-top-left-radius: 4px;
          border-bottom-left-radius: 4px;
        }

        .btn {
          font-size: 13px;
          padding: 6px 11px 6px;
          line-height: (17 / 13);
          border-top-right-radius: 4px;
          border-bottom-right-radius: 4px;
        }
      }
    }
  }

  .pickerbar {
    margin-bottom: 20px;

    &__date {
      display: inline-block;
      width: 154px;
      margin-right: 674px;
    }

    &__status {
      display: inline-block;
      width: 202px;
    }

    .bootstrap-select .dropdown-toggle {
      border-radius: 0;

      .filter-option {
        padding-left: 19px;
      }
      .filter-option-inner {
        padding-right: 0;
        text-align: center;
        font-size: 16px;
        color: #2F3032;
      }
    }
  }

  &__list {
    &.empty {
      padding-top: 72px;
      padding-bottom: 72px;
    }
  }

  &box {
    position: relative;
    margin-bottom: 20px;

    &__hd {
      background-color: #EEF3FF;
      overflow: hidden;

      .hd {
        &__inner {
          float: left;
          position: relative;
          padding: 8px 47px 7px 21px;
          background-color: $primary;
          color: #fff;
          font-size: 14px;
          line-height: (19 / 14);
          overflow: hidden;
  
          &:before, &:after {
            position: absolute;
            content: '';
          }
  
          &:before {
            top: 0;
            left: 0;
            border-right: 20px solid transparent;
            border-top: 20px solid $warning-dark;
            border-left: 0;
            border-bottom: 0;
          }
  
          &:after {
            right: 0;
            top: 0;
            border-top: 33px solid #EEF3FF;
            border-left: 40px solid transparent;
            border-right: 0;
            border-bottom: 0;
          }
        }
  
        &__txt {
          display: inline-block;
  
          + .hd__txt {
            margin-left: 30px;
          }
        }
      }
    }

    &__bd {
      display: table;
      width: 100%;
      min-height: 136px;
      border: 1px solid #E9E8E9;

      %bd__cell {
        display: table-cell;
        position: relative;
        padding: 10px 15px;
        vertical-align: middle;
        text-align: center;
        font-size: 14px;
      }

      @each $name, $width in (product 228px, interest 148px, figure 232px, installment 208px, status 193px, ops 188px) {
        .bd__cell--#{$name} {
          @extend %bd__cell;
          width: $width;

          @if $name != product {
            &:before {
              position: absolute;
              content: '';
              height: 43px;
              width: 1px;
              background-color: #E8E8E8;
              top: 50%;
              left: 0;
              margin-top: -21px;
            }
          }
        }
      }

      .bd__cell {
        &--installment {
          .installment {
            @include clearfix();

            &__phase {
              float: left;
              margin-right: 10px;
              padding: 4px 3px;
              font-size: 20px;
              color: $primary;
              font-weight: 600;
              background-color: #F6F9FF;
              border: 1px solid #C2CFEA;
            }

            &__repay {
              float: left;
              font-size: 14px;
              text-align: left;
              white-space: nowrap;

              > .repay-method {
                color: #A1A1A1;
              }

              > .installment-account {
                color: $primary;
                text-decoration: underline;
              }
            }
          }
        }

        &--ops {
          padding-left: 50px;
          padding-right: 50px;

          .btn {
            margin-bottom: 10px;
            padding: 8px 14px 7px;
            min-width: 84px;
            font-size: 14px;
            border-radius: 4px;

            &:last-child {
              margin-bottom: 0;
            }

            &-default {
              color: #777;
              background-color: #eee;
              border-color: #eee;

              &:hover {
                border-color: darken(#eee, 15%);
                background-color: darken(#eee, 15%);
              }
            }
          }
        }
      }
    }

    &__bold {
      margin: 0;
      font-size: 20px;
      font-weight: 600;
      color: #444E5B;
    }

    &__label {
      font-size: 14px;
      color: #9B9B9B;
    }

    &__scribe {
      display: inline-block;
      margin-bottom: 3px;
      padding: 4px 17px 3px 9px;
      background-color: #F1F1F1;
      color: #9B9B9B;
      font-size: 14px;
      text-align: left;
      white-space: nowrap;

      > .dark {
        color: #444E5B;
      }

      &%scribe-styles {
        padding: 5px 10px 4px;
        text-align: center;
        font-weight: 600;
      }

      @each $name, $color, $bg in (inform, #F5A623, #FFF6E9),
                                  (warning, #F5A623, #FFF6E9),
                                  (danger, #FC6F43, #FFD9CD),
                                  (sucess, #1AC111, #BCFBDB),
                                  (primary, #6897FF, #E8EEF7),
                                  (muted, #FFFFFF, #C3C3C3),
                                  (failure, #FFFFFF, #5E5133) {
        &--#{$name} {
          @extend %scribe-styles;
          color: $color;
          background-color: $bg;
        }
      }
    }

    &__refund {
      display: table;
      position: relative;
      width: 100%;
      border: 1px solid #E9E8E9;
      border-top: 0;

      &:before,
      &:after {
        position: absolute;
        content: '';
        border-bottom: 14px solid transparent;
        border-left: 10px solid transparent;
        border-right: 10px solid transparent;
        top: -14px;
        left: 695px;
      }

      &:before {
        border-bottom-color: #E9E8E9;
      }

      &:after {
        border-bottom-color: #fff;
        top: -12px;
      }

      .refund {
        &__inner,
        &__right {
          display: table-cell;
        }

        &__inner {
          width: 826px;
        }

        &__right {
          text-align: center;
          vertical-align: middle;

          .btn {
            padding: 10px 30px 12px;
          }

          .icon--triangle-down:after {
            border-top-color: #fff;
          }
        }

        &__table {
          width: 100%;
          border-right: 1px solid #E9E8E9;

          > thead > tr,
          > tbody > tr:not(:last-child) {
            border-bottom: 1px solid #EAEDF4;
          }

          > tbody > tr:nth-child(2n) {
            background-color: #FDFDFD;
          }

          > thead > tr > th,
          > tbody > tr > td {
            font-size: 14px;
            color: #52555D;
            text-align: left;
            vertical-align: middle;
            line-height: (19 / 14);

            &:first-child {
              width: 52px;
              padding-left: 16px;
              padding-right: 16px;
            }
          }

          > thead > tr > th {
            padding-top: 8px;
            padding-bottom: 13px;
            font-weight: 700;
            color: #333;
          }

          > tbody > tr > td {
            padding-top: 11px;
            padding-bottom: 11px;
          }
        }
      }
    }
  }
}
